home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / science / sm32a.zip / SYMBMATH.H40 < prev    next >
Text File  |  1994-03-30  |  4KB  |  121 lines

  1.           4.8  Sums, Products, Series and Polynomials
  2.  
  3.     You can compute partial, finite or infinite sums and products.
  4. Sums and products can be differentiated and integrated. You construct
  5. functions like Taylor polynomials or finite Fourier series. The
  6. procedure is the same for sums as products so all examples will
  7. be restricted to sums.  The general formats for these functions are:
  8.         sum(expr, x from xmin to xmax)
  9.         sum(expr, x from xmin to xmax step dx)
  10.         prod(expr, x from xmin to xmax)
  11.         prod(expr, x from xmin to xmax step dx)
  12. The expression expr is evaluated at xmin, xmin+dx, ...  up to the last
  13. entry in the series not greater than xmax, and the resulting values
  14. are added or multiplied.  The part "step dx" is optional and defaults 
  15. to 1.  The values of xmin, xmax and dx can be any real number.
  16.  
  17. Here are some examples:
  18.      sum(j, j from 1 to 10)   
  19. for 1 + 2 + .. + 10.
  20.       sum(3^j, j from 0 to 10 step 2)  
  21. for 1 + 3^2 + ... + 3^10.
  22.       Here are some sample Taylor polynomials:
  23.     sum(x^j/j!, j from 0 to n)  
  24. for exp(x).
  25.     sum((-1)^j*x^(2*j+1)/(2*j+1)!, j from 0 to n)
  26. for sin(x) of degree 2*n+2.
  27.  
  28.     Remember, the 3 keywords (from, to and step) can be replaced by
  29. the comma ,.
  30.         
  31.         4.8.1.  Partial Sum
  32.     The function
  33.         partsum(f(x),x)
  34. finds the partial sum (symbolic sum).
  35.  
  36.     Example 4.8.1.1.
  37. Find the sum of 1^2 + 2^2 ... + n^2.       
  38.  
  39. IN:  partsum(n^2, n)
  40. OUT: 1/6 n (1 + n) (1 + 2 n)
  41.  
  42.         4.8.2  Infinite Sum 
  43.     The function
  44.         infsum(f(x),x)  
  45. finds the infinite sum, i.e. sum(f(x), x from 0 to inf).
  46.     Example:
  47.  
  48. IN:  infsum(1/n!, n)
  49. OUT: e
  50.  
  51.         4.8.3.  Series 
  52.     The external functions 
  53.         series(f(x), x)
  54.         series(f(x), x, order)
  55. to find the Taylor series at x=0. The arguement (order) is optional and 
  56. defaults to 5.
  57.     
  58.     Example 4.8.3.1. 
  59. Find the power series expansion for cos(x) at x=0. 
  60.  
  61. IN:  series(cos(x), x)
  62. OUT: 1 - 1/2 x^2 + 1/24 x^4
  63.  
  64.     The series expansion of f(x) is useful for numeric calculation
  65. of f(x). If you can provide derivative of any function of f(x) and f(0),
  66. even though f(x) is unknown, you may be able to calculate the function
  67. value at any x, by series expansion. Accurary of calculation depends on
  68. the order of series expansion. Higher order, more accuracy, but longer
  69. calculation time.
  70.     
  71.     Example 4.8.3.2. 
  72. calculate f(1), knowing f'(x)=-sin(x) and f(0)=1, where f(x) is unknown.
  73.  
  74. IN:  f'(x_) := -sin(x)
  75. IN:  f(0) := 1
  76. IN:  f(x_) := eval(series(f(x), x))         #  must eval()
  77. OUT: f(x_) := 1 - 1/2 x^2 + 1/24 x^4
  78. IN:  f(1)
  79. OUT: 13/24
  80.  
  81.                 4.8.4  Polynomials
  82.         Polynomials are automately sorted in order from low to high.
  83.         You can pick up one of coefficient of x in polynomials by
  84.                 coef(poly, x^n)
  85.         e.g.
  86. IN:  coef(x^2+5*x+6, x)
  87. OUT: 5
  88.  
  89.         Note that you cannot pick up the coefficient of x^0 by coef(y,x^0).
  90.         You can pick up one of coefficient of x in polynomials with
  91. order < 5 by
  92.                 coef(poly, x,n)
  93.         e.g.
  94. IN:  coef(x^2+5*x+6, x,0)
  95. OUT: 6
  96.  
  97.         You can pick up all of coefficients of x in polynomials with
  98. order < 5 by
  99.                 coefall(poly, x)
  100.         e.g.
  101. IN:  coefall(x^2+5*x+6, x)
  102. OUT: [6, 5, 1]                    # 6 + 5*x + x^2
  103. IN:  coefall(a*x^2+b*x+c, x)
  104. OUT: [c, b, a]                    # symbolic values of coefficients
  105.  
  106.         You can pick up the highest order of x in polynomials with
  107. order < 5 by
  108.                 order(poly, x)
  109.         e.g.
  110. IN:  order(x^2+5*x+6, x)
  111. OUT: 2
  112.  
  113.         You can factor polynomials in order < 5 with respect with x by
  114.                 factor(poly, x)
  115.         e.g.
  116. IN:  factor(x^2+5*x+6, x)
  117. OUT: (2 + x) (3 + x)
  118.  
  119.         Note that Shareware version of SymbMath cannot do this factor as
  120. it lacks solve().
  121.